//package org.dfzt;
//
//
//import org.apache.catalina.Context;
//import org.apache.commons.logging.Log;
//import org.apache.commons.logging.LogFactory;
//import org.apache.shiro.spring.boot.autoconfigure.ShiroAnnotationProcessorAutoConfiguration;
//import org.apache.shiro.spring.boot.autoconfigure.ShiroAutoConfiguration;
//import org.apache.shiro.spring.boot.autoconfigure.ShiroBeanAutoConfiguration;
//import org.apache.tomcat.util.scan.StandardJarScanner;
////import org.dfzt.flowable.conf.AppDispatcherServletConfiguration;
////import org.dfzt.flowable.conf.ApplicationConfiguration;
////import org.dfzt.flowable.conf.DatabaseAutoConfiguration;
//import org.springframework.boot.SpringApplication;
////import org.springframework.boot.actuate.autoconfigure.security.servlet.ManagementWebSecurityAutoConfiguration;
//import org.springframework.boot.autoconfigure.SpringBootApplication;
//import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
//import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
//import org.springframework.boot.autoconfigure.security.servlet.SecurityFilterAutoConfiguration;
//import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
//import org.springframework.context.ConfigurableApplicationContext;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Import;
//import org.springframework.context.annotation.ImportResource;
//import org.springframework.core.env.Environment;
//import springfox.documentation.swagger2.annotations.EnableSwagger2;
//
//import java.net.InetAddress;
//import java.net.UnknownHostException;
//
//
//
///**
// * 必读！！！！！
// * 默认pom中引用base-boot-api，common，system，message
// * 启用其他base-boot组件时 @exclude 中需要添加的类
// *
// * 1、开启flowable时添加，关闭时移除
// *      SecurityAutoConfiguration.class,
// *      SecurityFilterAutoConfiguration.class,
// *      DataSourceAutoConfiguration.class
// * 2、开启flowable时并引用componet包时添加，关闭时移除
// *      ManagementWebSecurityAutoConfiguration.class
// *      （关闭自动配置 否则会与componet包的actuator有冲突  会出现需要please sign in界面 并且所有接口失效）
// * 3、开启shiro的时移除，关闭时添加
// *      ShiroAnnotationProcessorAutoConfiguration.class,
// *      ShiroAutoConfiguration.class,
// *      ShiroBeanAutoConfiguration.class
// *
// * 启用其他base-boot组件时 @import 中需要添加的类
// * 1、开启flowable时添加
// *      ApplicationConfiguration.class,
// *      AppDispatcherServletConfiguration.class,
// *      DatabaseAutoConfiguration.class
// *
// * 启用duboo时 @ImportResource
// * 1、将此注解解开
// *
// * */
////@Import(value={
////        ApplicationConfiguration.class,
////        AppDispatcherServletConfiguration.class,
////        DatabaseAutoConfiguration.class
////})
//@EnableSwagger2
//@ImportResource(locations={"classpath:service-consumer.xml", "classpath:service-provider.xml"})
//@SpringBootApplication
//        (exclude = {
////                        SecurityAutoConfiguration.class,
////                        SecurityFilterAutoConfiguration.class,
////                        ManagementWebSecurityAutoConfiguration.class,
////                        DataSourceAutoConfiguration.class,
////                        ShiroAnnotationProcessorAutoConfiguration.class,
////                        ShiroAutoConfiguration.class,
////                        ShiroBeanAutoConfiguration.class
//                },
//        scanBasePackages = {"org.dfzt"})
//public class SpringBootPower {
//    private static final Log log = LogFactory.getLog(SpringBootPower.class);
//
//    public static void main(String[] args) throws UnknownHostException {
//
//        ConfigurableApplicationContext application = SpringApplication.run(SpringBootPower.class, args);
//        Environment env = application.getEnvironment();
//        String ip = InetAddress.getLocalHost().getHostAddress();
//        String port = env.getProperty("server.port");
//        String path = env.getProperty("server.servlet.context-path");
//        String[] beanNames = application.getBeanDefinitionNames();
//        log.info("bean总数：{"+application.getBeanDefinitionCount()+"}");
//        int i = 0;
//        for (String s : beanNames){
//            log.info("{"+(++i)+"},beanName: {"+s+"}");
//        }
//
//
//        log.info("-------application DONE----------\n");
//        log.info("\n----------------------------------------------------------\n\t" +
//                "Application Base-Boot is running! Access URLs:\n\t" +
//                "Local: \t\thttp://localhost:" + port + path + "/\n\t" +
//                "External: \thttp://" + ip + ":" + port + path + "/\n\t" +
//                "Swagger-UI: \t\thttp://" + ip + ":" + port + path + "/doc.html\n" +
//                "----------------------------------------------------------");
//
//    }
//
///**
//     * tomcat-embed-jasper引用后提示jar找不到的问题
//     */
//
//    @Bean
//    public TomcatServletWebServerFactory tomcatFactory() {
//        return new TomcatServletWebServerFactory() {
//            @Override
//            protected void postProcessContext(Context context) {
//                ((StandardJarScanner) context.getJarScanner()).setScanManifest(false);
//            }
//        };
//    }
//}
